﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="ChiTietTinRao.aspx.cs" Inherits="WebRaoVat.ChiTietTinRao" %>

<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <!--Begin khung thu 1 cua cot trai-->
    <div id="box-pro-highlights">
        <div class="box-pro-highlights-header">
            <a href="ChiTietDanhMucChinh.aspx?danhmucchinh=<% =maDanhMucChinh %>" style="color: #034b8a"
                class="no-hover">
                <% =tenDanhMucChinh %></a> <a style="color: #034b8a">> </a><a href="ChiTietDanhMucCon.aspx?danhmuccon=<% =maDanhMucCon %>"
                    style="color: #034b8a" class="no-hover">
                    <% =tenDanhMucCon %></a> <a style="color: #034b8a">> </a><a style="color: #034b8a">Chi tiết tin</a>
        </div>
        <div class="content">
            
                        
                        <asp:FormView ID="FormView1" runat="server" DataKeyNames="MaTinRaoVat" DataSourceID="SqlDataSource1" Width="100%">
                        
                       
                            <ItemTemplate>
              <table cellpadding="0" cellspacing="0" class="tblEbInfo">
                
                    <tr align="left">
                        
                        <td align="left" valign="top">
                                 <asp:Label ID="TenTinRaoVatLabel" runat="server" Style="color: #0034b8; font-size: large;
                                    font-weight: bold" Text='<%# Eval("TenTinRaoVat", "{0}") %>'/>
                                    
                                 <br />
                                 <br />
                                 <asp:Label ID="GiaTienLabel" runat="server" Style="color: Red; font-size: medium"
                                    Text='<%# Bind("GiaTien", "Giá: {0} VNĐ") %>' />
                                 <br />   
                                 <br />
                                 
                                <asp:Label ID="Label1" runat="server" style="font-weight: bold; color: #0034b8; font-size: small" Text="Người đăng:&nbsp;"></asp:Label>
                                <asp:LinkButton ID="LinkButton1" runat="server" style=" color: #0034b8; font-size: small" OnClick="lbtnNguoiDang_Click"><%= NguoiDungHienTai.TenNguoiDung %></asp:LinkButton>
                                
                                <br />
                                <a style="text-decoration: none; color: #0034b8; font-size: small; font-weight: bold">
                                    Số lượt xem:</a>
                                <asp:Label ID="SoLanXemLabel" runat="server" Style="text-decoration: none; color: #0034b8;
                                    font-size: small" Text='<%# Bind("SoLanXem") %>' />
                                <a style="text-decoration: none; color: #0034b8; font-size: small">lần</a>
                                <br />
                                
                                <asp:Label ID="Label3" runat="server" style="font-weight: bold; color: #0034b8; font-size: small">Địa điểm rao vặt: </asp:Label>
                                <asp:Label style="text-decoration: none; color: #0034b8; font-size: small"><%= DiaDiem %></asp:Label>
                                
                                <br />
                                <a style="text-decoration: none; color: #0034b8; font-size: small; font-weight: bold">
                                    Thời gian rao vặt:</a>
                                <asp:Label ID="ThoiGianDangLabel" runat="server" Style="text-decoration: none; color: #0034b8;
                                    font-size: small" Text='<%# Bind("ThoiGianDang") %>' />
                                <br />
                                
                        </td>
                        
                        
                        
                    </tr>
                    <tr align="left">
                        <td align="left">
                        
                                <asp:Label ID="NoiDungTinRaoVatLabel" runat="server" ForeColor="Black" Text='<%# Bind("NoiDungTinRaoVat") %>' />
                                
                         </td>
                    </tr>
                
            </table>
            
                            </ItemTemplate>
                        </asp:FormView>
                        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:RAOVATConnectionString %>"
                            SelectCommand="SELECT * FROM [TINRAOVAT] WHERE ([MaTinRaoVat] = @MaTinRaoVat)">
                            <SelectParameters>
                                <asp:QueryStringParameter Name="MaTinRaoVat" QueryStringField="MaTin" Type="Int32" />
                            </SelectParameters>
                        </asp:SqlDataSource>
                    
            <br />
            <br />
            <div>
                <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
                </asp:ToolkitScriptManager>
                <asp:Panel ID="pnBaoCaoViPham1" runat="server" Font-Size="Larger" ForeColor="#034b8a">
                    <asp:Image ID="imgBaoCaoViPham" runat="server" />
                    <a style="color:#034b8a" >Báo cáo vi phạm</a>
                    <asp:Label ID="lbBaoCaoViPham" runat="server"></asp:Label>
                </asp:Panel>
                <div style="height: 8px">
           &nbsp;
                </div>
                <asp:UpdatePanel ID="UpdatePanelBaoCaoViPham" runat="server">
                    <ContentTemplate>
                        <asp:CollapsiblePanelExtender ID="CollapsiblePanelExtenderBaoCaoViPham" runat="server"
                            Collapsed="True" TargetControlID="pnBaoCaoViPham2" CollapseControlID="pnBaoCaoViPham1"
                            CollapsedImage="images/Expand.png" CollapsedText="(Mở ra)" ExpandControlID="pnBaoCaoViPham1"
                            ExpandedImage="images/collape.png" ExpandedText="(Đóng lại)" ImageControlID="imgBaoCaoViPham"
                            TextLabelID="lbBaoCaoViPham">
                        </asp:CollapsiblePanelExtender>
                        <asp:Panel ID="pnBaoCaoViPham2" runat="server">
                            <% if (Session["NguoiDungDangDangNhap"] == null || Session["NguoiDungDangDangNhap"].ToString().Length <= 0)
                               {                            
                            %>
                            <p>
                                <a href="DangNhap.aspx" style="font-size: medium; color: #034b8a">Bạn cần đăng nhập để thực
                                    hiện điều này ! </a>
                            </p>
                            <% }
                               else
                               { %>
                            <table cellpadding="0" cellspacing="0" class="tblEbInfo">
                                <tr>
                                    
                                    <td align="left">
                                        <br />
                                        Báo cáo vi phạm:
                                        <asp:DropDownList ID="ddlBaoViPham" runat="server" Width="200px">
                                        </asp:DropDownList>
                                        <br />
                                        <br />
                                        Tại sao vi phạm:  
                                        <asp:TextBox ID="txtLyDo" runat="server" TextMode="MultiLine" Width="400px"></asp:TextBox>
                                        <br />
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center">
                                        <asp:Button ID="btnGoi" runat="server" Text="Gởi" OnClick="btnGoi_Click" />
                                        <br />
                                    </td>
                                 </tr>
                                 <tr>    
                                    <td>
                                        <br />
                                        <% if (ListMessage.Count > 0)
                                           {
                                               for (int i = 0; i < ListMessage.Count; ++i)
                                               {                                                                                                                                      
                                        %>
                                        <div style="font-size:medium; color:Red">
                                            <%= ListMessage[i]%>
                                        </div>
                                        <% } %>
                                        <p>
                                            &nbsp;</p>
                                        <% } %>
                                    </td>
                                </tr>
                            </table>
                            <% } %>
                        </asp:Panel>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </div>
            <br />
            <br />
        </div>
    </div>
    <!--Begin khung thu 2 cua cot trai-->
    <div id="box-pro-highlights">
        <div class="box-pro-highlights-header">
            <a style="color: #034b8a">Bình luận sản phẩm</a>
        </div>
        <div>
        
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            
            <ContentTemplate>
       
                
       
       
       <table cellpadding="0" cellspacing="0" class="tblEbInfo">
                <tr>
                    <td style="width:100%; text-align:left">
                        
                        <asp:DataList ID="DataList1" runat="server" DataKeyField="MaBaiTraLoi" DataSourceID="SqlDataSource2"
                            RepeatColumns="1" RepeatDirection="Horizontal" Width="100%">
                            <ItemTemplate>
                                <img src="images/tick_32.png" style="width: 18px; height: 15px;font-size:11px" />
                                <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("MaNguoiDung", "~/NguoiDung.aspx?MaNguoiDung={0}") %>'
                                     Font-Size="Medium" Font-Bold="true" ForeColor="#034b8a"><%# Eval("TenNguoiDung", "{0}") %></asp:HyperLink>
                                <asp:Label ID="ThoiGianTraLoiLabel" runat="server"
                                    Font-Size="Smaller"><a style="font-size:small; color: #034b8a"><%# Eval("ThoiGianTraLoi", " ({0})") %></a></asp:Label>
                                <br />
                                &nbsp;<asp:Label ID="Label2" runat="server"><a style="font-size:small; color:Black"><%# Eval("NoiDungTraLoi") %></a></asp:Label>
                                
                            </ItemTemplate>
                        </asp:DataList>
                    </td>
                </tr>
                <tr>
                    <td style="width: 100%">
                        &nbsp;
                    </td>
                </tr>
                <% if (Session["NguoiDungDangDangNhap"] == null || Session["NguoiDungDangDangNhap"].ToString().Length <= 0)
                   {                    
                %>
                <tr>
                    <td style="width: 100%">
                        <a href="DangNhap.aspx" style="color:#034b8a">Bạn cần đăng nhập để gởi phản hồi !</a>
                        <br />
                        <br />
                        <br />
                    </td>
                </tr>
                <% }
                   else
                   { %>
                <tr>
                    <td style="width: 100%; text-align:center; color:#0034b8" valign="top">
                    Ý kiến của bạn:
                        
                        
                        <asp:TextBox ID="CKEditorControl1" runat="server" TextMode="MultiLine" Width="463px" Height="50px"/>
                        
                        <br />
                        <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Gửi ý kiến" />
                        <br />
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                            ControlToValidate="CKEditorControl1" 
                            ErrorMessage="Nội dung ý kiến không được trống!"></asp:RequiredFieldValidator>
                        <br />
                        <br />
                    </td>
                </tr>
                <% } %>
            </table>
            <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:RAOVATConnectionString %>"
                SelectCommand="SELECT BAITRALOI.MaBaiTraLoi, BAITRALOI.MaNguoiDung, NGUOIDUNG.TenNguoiDung, BAITRALOI.NoiDungTraLoi, BAITRALOI.ThoiGianTraLoi FROM BAITRALOI INNER JOIN NGUOIDUNG ON BAITRALOI.MaNguoiDung = NGUOIDUNG.MaNguoiDung WHERE ((BAITRALOI.MaTinRaoVat = @MaTinRaoVat) AND 
                (BAITRALOI.Deleted = 0))  ORDER BY [ThoiGianTraLoi] DESC">
                <SelectParameters>
                    <asp:QueryStringParameter Name="MaTinRaoVat" QueryStringField="MaTin" Type="Int32" />
                </SelectParameters>
            </asp:SqlDataSource>
       
       
            
            </ContentTemplate>     
            
            </asp:UpdatePanel>
        </div>
    </div>
    <!--End khung thu 2 cua cot trai-->
</asp:Content>
